<?php

class MY_Controller extends CI_Controller
{
    var $admin = FALSE;
    var $member= FALSE;
    var $tool= FALSE;
    function __construct()
    {
    	parent::__construct();
    	

     $this->admin = $this->session->userdata('admin_id') ? admin::find($this->session->userdata('admin_id')) : FALSE;
     $this->member = $this->session->userdata('member_id') ? member::find($this->session->userdata('member_id')) : FALSE;
     $this->tool = $this->session->userdata('tool_id') ? tool::find($this->session->userdata('tool_id')) : FALSE;
     $this->discount = discount::find('all',array('conditions'=>array('discount_type = ? AND discount_start < ? AND discount_end > ?' ,'general',date('y-m-d h:i:s'),date('y-m-d h:i:s') )));
     $this->discount_delivery = discount::find('all',array('conditions'=>array('discount_type = ? AND discount_start < ? AND discount_end > ?' ,'commune',date('y-m-d h:i:s'),date('y-m-d h:i:s') )));	
    }
	
    function title($title)
	{
		if($title == 'home'){
	 	return $title_text = 'Neuf-Neuf Dragon | Traiteur Chinois Bruxelles';
		}else{
		return $title_text = 'Neuf-Neuf Dragon | '.$title;
		}
	}
}